/*
 * @Author: your name
 * @Date: 2021-12-20 19:07:58
 * @LastEditTime: 2021-12-21 19:10:35
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \day10 react\my-app\src\router\index.js
 */
import {BrowserRouter,Route,Redirect,Switch} from "react-router-dom"
import Index from "../views/index/index"
import Classify from "../views/classify/classify"
import Coll from "../views/coll/coll"


function RootRouter(){
    return <BrowserRouter>
        <Switch>
            <Route path="/index" component={Index}/>
            <Route path="/classify" component={Classify}/>
            <Route path="/coll" render={(props)=>{
                return <Coll {...props}/>
            }}/>
            <Redirect from="/" to="/index"/>
        </Switch>
    </BrowserRouter>
}

export default RootRouter